package com.asset.salesforce.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.asset.salesforce.dao.AccountDaoImpl;
import com.asset.salesforce.domain.Account;;

@Service
@Transactional(readOnly=true)
public class AccountService {
	
	@Autowired 
	private AccountDaoImpl accountDaoImpl;
	
	@Transactional(readOnly=false)
	public void addAccount(Account account) {
		accountDaoImpl.addAccount(account);
	}
	@Transactional(readOnly=true)
	public List<Account> getAllAccountByEmpId(Integer id) {
		return accountDaoImpl.getAllAccountByEmpId(id);
	}
	@Transactional(readOnly=true)
	public Account getAccount(Integer id) {
		return accountDaoImpl.getAccount(id);
	}
	@Transactional(readOnly=true)
	public Account getAccountByName(String accountName) {
		return accountDaoImpl.getAccountByName(accountName);
	}
	@Transactional(readOnly=true)
	public List<Account> getAllAccount(Integer index) {
		return accountDaoImpl.getAllAccount(index);
	}
	@Transactional(readOnly=false)
	public void saveOrUpdate(Account account) {
		accountDaoImpl.saveOrUpdate(account);
	}
	@Transactional(readOnly=false)
	public void deleteAccount(Integer id) {
		accountDaoImpl.deleteAccount(id);
	}
	
	@Transactional(readOnly=true)
	public Integer getAllAccountSize() {
		return accountDaoImpl.getAllAccountSize();
	}
	
	@Transactional(readOnly=true)
	public Integer getAllAccountForCompanySize(String companySize) {
		return accountDaoImpl.getAllAccountForCompanySize(companySize);
	}
	
	@Transactional(readOnly=true)
	public List<Account> getAllAccountForCompany(Integer index,String companyName,Integer count) {
		return accountDaoImpl.getAllAccountForCompany(index, companyName,count);
	}
	@Transactional(readOnly=true)
	public Account getAccountByEmpolyee(Integer empId){
		return accountDaoImpl.getAccountByEmpId(empId);
	}
}
